/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpa;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author admin
 */
@Entity
@Table(name = "uploadTemp")
@NamedQueries({
    @NamedQuery(name = "UploadTemp.countFile", query="SELECT COUNT(u.id) FROM UploadTemp u"),
    @NamedQuery(name = "UploadTemp.findAll", query = "SELECT u FROM UploadTemp u"),
    @NamedQuery(name = "UploadTemp.findById", query = "SELECT u FROM UploadTemp u WHERE u.id = :id"),
    @NamedQuery(name = "UploadTemp.findByData", query = "SELECT u FROM UploadTemp u WHERE u.data = :data"),
    @NamedQuery(name = "UploadTemp.findByTitolo", query = "SELECT u FROM UploadTemp u WHERE u.titolo = :titolo"),
    @NamedQuery(name = "UploadTemp.findByLink", query = "SELECT u FROM UploadTemp u WHERE u.link = :link"),
    @NamedQuery(name = "UploadTemp.findByStudenteid", query = "SELECT u FROM UploadTemp u WHERE u.studenteid = :studenteid"),
    @NamedQuery(name = "UploadTemp.findByDescr", query = "SELECT u FROM UploadTemp u WHERE u.descr = :descr"),
    @NamedQuery(name = "UploadTemp.findByCorsoid", query = "SELECT u FROM UploadTemp u WHERE u.corsoid = :corsoid")})
public class UploadTemp implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "data")
    @Temporal(TemporalType.DATE)
    private Date data;
    @Basic(optional = false)
    @Column(name = "titolo")
    private String titolo;
    @Basic(optional = false)
    @Column(name = "link")
    private String link;
    @Basic(optional = false)
    @Column(name = "studenteid")
    private int studenteid;
    @Basic(optional = false)
    @Column(name = "descr")
    private String descr;
    @Basic(optional = false)
    @Column(name = "corsoid")
    private int corsoid;

    public UploadTemp() {
    }

    public UploadTemp(Integer id) {
        this.id = id;
    }

    public UploadTemp(Integer id, Date data, String titolo, String link, int studenteid, String descr, int corsoid) {
        this.id = id;
        this.data = data;
        this.titolo = titolo;
        this.link = link;
        this.studenteid = studenteid;
        this.descr = descr;
        this.corsoid = corsoid;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }

    public String getTitolo() {
        return titolo;
    }

    public void setTitolo(String titolo) {
        this.titolo = titolo;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public int getStudenteid() {
        return studenteid;
    }

    public void setStudenteid(int studenteid) {
        this.studenteid = studenteid;
    }

    public String getDescr() {
        return descr;
    }

    public void setDescr(String descr) {
        this.descr = descr;
    }

    public int getCorsoid() {
        return corsoid;
    }

    public void setCorsoid(int corsoid) {
        this.corsoid = corsoid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UploadTemp)) {
            return false;
        }
        UploadTemp other = (UploadTemp) object;
        return (this.id != null || other.id == null) && (this.id == null || this.id.equals(other.id));
    }

    @Override
    public String toString() {
        return "jpa.UploadTemp[id=" + id + "]";
    }

}
